
#ifndef __dpcH__
#define __dpcH__

#include "kernel.h"

namespace WtfEngine {
	/**
	 * Deferred Procedure Call dispatcher - allows a call
	 * to be deferred until the end of the frame.
	 **/
	class DpcDispatcher: public Task<DpcDispatcher> {
		std::list<Functor::tRef> mDpcs;

	public:
		DpcDispatcher();

		void QueueDpc(const Functor::tRef& rDpc);

	protected:
		void Run();
	};
};

#endif
